Unit ujfglSoapDM;

interface

uses SysUtils, Classes, InvokeRegistry, Midas, SOAPMidas, SOAPDm, DB, ADODB,
  Provider, DBClient;

type
  IjfglSoapDM = interface(IAppServerSOAP)
    ['{60DBFA37-9E9F-4417-9E9F-4774FAAA4F45}']
  end;

  TjfglSoapDM = class(TSoapDataModule, IjfglSoapDM, IAppServerSOAP, IAppServer)
    sp_All_Xj_Process: TADOStoredProc;
    ads_Query: TADODataSet;
    cds_Query: TClientDataSet;
    dsp_Query: TDataSetProvider;
    sp_Get_Xs_Status_In_Room: TADOStoredProc;
    sp_Is_JxXj_Time: TADOStoredProc;
    sp_Insert_Into_Sj_Record2: TADOStoredProc;
    sp_Card_Cz_Process: TADOStoredProc;
    sp_In_Jx_Time: TADOStoredProc;
    sp_Insert_Into_Sj_Record: TADOStoredProc;
    sp_Xj_Process: TADOStoredProc;
    Access_Connection: TADOConnection;
    ADOConnection1: TADOConnection;
    procedure SoapDataModuleDestroy(Sender: TObject);
    procedure SoapDataModuleCreate(Sender: TObject);
  private
  
  public
  
  end;

implementation
uses uDbConnect;
{$R *.DFM}

procedure TjfglSoapDMCreateInstance(out obj: TObject);
begin
 obj := TjfglSoapDM.Create(nil);
end;

procedure TjfglSoapDM.SoapDataModuleCreate(Sender: TObject);
begin
  ADOConnection1.Connected := False;
  ADOConnection1.ConnectionString := '';
  ADOConnection1.ConnectionString := GetConnectString;
  if ADOConnection1.ConnectionString = '' then
  begin
    Sleep(200);
    ADOConnection1.ConnectionString := GetConnectString;
  end;
end;

procedure TjfglSoapDM.SoapDataModuleDestroy(Sender: TObject);
begin
  ADOConnection1.Close;
  ADOConnection1.Connected := False;
end;

initialization
   InvRegistry.RegisterInvokableClass(TjfglSoapDM, TjfglSoapDMCreateInstance);
   InvRegistry.RegisterInterface(TypeInfo(IjfglSoapDM));
end.
